#include<bits/stdc++.h>
using namespace std;

vector<int> intersection(vector<vector<int>>& nums)
{
    vector<int> cnt(1000);
    for(auto &i:nums)
        for(auto j:i)
            cnt[j-1]++;
    vector<int> ans;
    for(int i = 0;i < 1000;i++)
        if(cnt[i] == nums.size())
            ans.push_back(i+1);
    return ans;
}

int main()
{
	vector<vector<int>> nums;
	int m, n, x;
	cin>>m;
	while(m--)
	{
		cin>>n;
		vector<int> a;
		while(n--)
		{
			cin>>x;
			a.push_back(x);
		}
		nums.push_back(a);
	}
	vector<int> ans = intersection(nums);
	for(auto i:ans)
		cout<<i<<" ";
	return 0;
}

